package com.jeff.tianti.cms.service;

import com.jeff.tianti.cms.dao.CertificateDao;
import com.jeff.tianti.cms.dao.PrizeDao;
import com.jeff.tianti.cms.dto.CertificateQueryDTO;
import com.jeff.tianti.cms.dto.PrizeQueryDTO;
import com.jeff.tianti.cms.entity.Certificate;
import com.jeff.tianti.cms.entity.Course;
import com.jeff.tianti.cms.entity.Prize;
import com.jeff.tianti.common.PageBean;
import com.jeff.tianti.common.entity.PageModel;
import com.jeff.tianti.common.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PrizeService extends CommonService<Prize, String> {
    @Autowired
    private PrizeDao prizeDao;

    @Autowired
    public void setCertificateDao(PrizeDao prizeDao) {
        super.setCommonDao(prizeDao);
    }

    public PageModel<Prize> queryPrizePage(PrizeQueryDTO prizeQueryDTO) {
        return this.prizeDao.queryPrizePage(prizeQueryDTO);
    }

    public int updateSelective(Prize prize) {
        return prizeDao.updateSelectiveById(prize);
    }

    public Page<Prize> findAllNoDelAndPage(Pageable pageable) {
        return this.prizeDao.findAll(pageable);
    }

    public PageModel<Map<String, Object>> queryPrizeList(PageBean pageBean) {
        return this.prizeDao.queryPrizeList(pageBean);
    }

    public  List<Prize> findAllByColumnId(String columnId){
        return this.prizeDao.findAllByColumnId(columnId);
    }

}
